package org.dna.metronomo.persistence;

import java.util.List;
import org.dna.mybatis.criteria.Criteria;
import org.tigris.scarab.model.Activity;

public interface IActivityDAO {

    /**
     * Return the list of all activities registered on the DB.
     * */
    List<Activity> allActivities() throws PersistenceException;

    /**
     * Add a new activity
     * */
    void addNewActivity(Activity activity) throws PersistenceException;

    /**
     * Remove an activity using the instance as template
     * */
    void deleteActivityByExample(Criteria criteria) throws PersistenceException;

    /**
     * Removes an activity identified by the ID.
     * */
    void deleteActivityByID(long id) throws PersistenceException;

    /**
     * Return the activity identified by the ID, or null if not exists.
     * */
    Activity queryActivityByID(long id) throws PersistenceException;

    /**
     * Return the list of activities identified by the query, or empty list.
     * */
    List<Activity> queryActivityByExample(Criteria criteria) throws PersistenceException;

    /**
     * Update the Activity identified by the ID
     */
    void updateByID(Activity activity) throws PersistenceException;

    /**
     * Return the count of Activities that match the criteria, else 0 if anyoune
     * doesn't match.
     */
    int countByExample(Criteria criteria) throws PersistenceException;
}
